package week0501;
import java.awt.*;
import javax.swing.*;

public class Main2 {
	
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				SimpleFrame frame=new SimpleFrame();
				frame.setTitle("郑玉波");
				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				frame.setLocation(400, 200);
				frame.setVisible(true);
			}
		});
		
	}

}

class SimpleFrame extends JFrame{
	
	private static final long serialVersionUID = 1L;

	public SimpleFrame(){
		Toolkit kit =Toolkit.getDefaultToolkit();
		Dimension screenSize=kit.getScreenSize();
		int screenHeight=screenSize.height;
		int screenWidth=screenSize.width;
		setSize(screenWidth/2 ,screenHeight/2 );
		setLocationByPlatform(true);
		Image img=new ImageIcon("icon.gif").getImage();
		setIconImage(img);
	}	
	
}




